from ptk import *
from ptk.mdl import *


## PRO_MDL_UNUSED     = PRO_TYPE_UNUSED,-1
##   PRO_MDL_ASSEMBLY   = PRO_ASSEMBLY,1
##   PRO_MDL_PART       = PRO_PART,2
##   PRO_MDL_DRAWING    = PRO_DRAWING,4
##   PRO_MDL_3DSECTION  = PRO_3DSECTION,7
##   PRO_MDL_2DSECTION  = PRO_2DSECTION,11
##   PRO_MDL_LAYOUT     = PRO_LAYOUT,19
##   PRO_MDL_DWGFORM    = PRO_DWGFORM,33
##   PRO_MDL_MFG        = PRO_MFG,37
##   PRO_MDL_REPORT     = PRO_REPORT,105
##   PRO_MDL_MARKUP     = PRO_MARKUP,106
##   PRO_MDL_DIAGRAM    = PRO_DIAGRAM,121

mdltypes={
        -1	:	None	,
        1	:	Assembly	,
        2	:	Part
        }


def cur():
    return Mdl_(MdlCurrentGet())

def OpenFile(filepath):
    mdl = MdlLoad(filepath,-1,0)
    mdltype = MdlTypeGet(mdl)
    return mdltypes[mdltype.value](mdl)




